package com.jzy.gulimall.product.feign;

import com.jzy.common.to.SkuReductionTo;
import com.jzy.common.to.SpuBoundTo;
import com.jzy.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author jzy
 * @date 2020/9/8 19:28
 */
@FeignClient("gulimall-coupon")
public interface CouponFeignService {

    /**
     * 1.@RequestBody 将对象转为 json
     * 2.找到服务,发送请求,将json放在请求体位置
     * 3.对方服务收到请求.请求体里有json
     * 4.对方服务的@RequestBody将json转换类型
     */
    @PostMapping("/coupon/spubounds/save")
    R saveSpuBounds(@RequestBody SpuBoundTo spuBoundTo);

    @PostMapping("/coupon/skufullreduction/saveReduction")
    R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);
}
